<template>
	<view class="container">
		<view class="activity_video" v-if="acvicity_detail.acvicity_video != ''">
			<video :src="acvicity_detail.acvicity_video" autoplay loop muted duration="15" :controls="false"></video>
		</view>
		<swiper class="swiper" :indicator-dots="false" :autoplay="true" :circular="true" :interval="5000" :duration="1000">
			<swiper-item v-for="(item,index) in acvicity_detail.acvicity_banner_image">
				<view class="swiper-item">
					<image :src="item" mode="scaleToFill"></image>
				</view>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
	import api from '@/comon/api.js'
	export default {
		data(){
			return {
				id: 0,
				acvicity_detail:{
					acvicity_video: ''
				}
			}
		},
		onLoad(option) {
			if(option.id){
				this.id = option.id
			}
			this.loadData()
		},
		methods:{
			async loadData(){
				let res = await api.uniCloudApi(api.publicFun.activity,{id:this.id,activity_type:1});
				if(res){
					uni.setNavigationBarTitle({
						title:res[0].acvicity_name
					})
					this.acvicity_detail = res[0];
					console.log(res[0])
				}
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-image: linear-gradient(to bottom,#d61b1b,#ffb97b);
	}
	.activity_video{
		width: 100%;
		height: 350rpx;
		video{
			width: 100%;
			height: 350rpx;
		}
	}
	.swiper{
		width: 100%;
		height: 400rpx;
		image{
			width: 100%;
		}
	}
	
</style>
